﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="Ribbon.Library.PMEDeveloperGroup"
    RegistrationType="List"
    RegistrationId="850"
    Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Library.Groups._children">
          <Group
            Id="Ribbon.Library.PMEDeveloperGroup"
            Sequence="55"
            Description="$Resources:PageManifestExtractor,GroupDescription"
            Title="$Resources:PageManifestExtractor,GroupTitle"
            Command="EnablePMEDeveloperGroupOnLibrary"
            Template="Ribbon.Templates.Flexible2">
            <Controls Id="Ribbon.Library.PMEDeveloperGroup.Controls">
              <Button
                Id="Ribbon.Library.PMEDeveloperGroup.ExtractAllManifestButton"
                Command="ClickExtractAllManifestButton"
                Image16by16="_layouts/15/images/PageManifestExtractor/PMEButton16by16.png"
                Image32by32="_layouts/15/images/PageManifestExtractor/PMEButton32by32.png"
                LabelText="$Resources:PageManifestExtractor,ExtractAllButtonTitle"
                TemplateAlias="o2"
                Sequence="15" />
            </Controls>
          </Group>
        </CommandUIDefinition>
        <CommandUIDefinition
          Location="Ribbon.Library.Scaling._children">
          <MaxSize
            Id="Ribbon.Library.Scaling.PMEDeveloperGroup.MaxSize"
            Sequence="15"
            GroupId="Ribbon.Library.PMEDeveloperGroup"
            Size="LargeLarge" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="EnablePMEDeveloperGroupOnLibrary"
          CommandAction="javascript:return true;" />
        <CommandUIHandler
          Command="ClickExtractAllManifestButton"
          CommandAction="javascript:
          
          
          //var pagelistUrl = _spPageContextInfo.serverRequestUrl ;
          //alert(_spPageContextInfo.webAbsoluteUrl + '/_layouts/PageManifestExtractor/PageManifest.aspx?PageLisId=' + SP.ListOperation.Selection.getSelectedList());
          
          
          var options = {              
                url: _spPageContextInfo.webAbsoluteUrl + '/_layouts/PageManifestExtractor/PageManifest.aspx?PageLisId=' + SP.ListOperation.Selection.getSelectedList(),
                tite: 'Page Manifest',
                allowMaximize: true,
                showClose: true,
                width: 800,
                height: 600 
          };
              
          SP.UI.ModalDialog.showModalDialog(options);" />
          
          
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>
